package one.stand.controller;

import com.jmp.base.GoodsTypeApi;
import com.jmp.base.dto.GoodsTypeDeleteRequest;
import lombok.extern.slf4j.Slf4j;
import one.stand.facade.GoodsFacadeService;
import one.stand.model.ResultModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author cjr
 */
@RestController
@Slf4j
public class GoodsTypeController implements GoodsTypeApi {
    @Autowired
    private GoodsFacadeService goodsFacadeService;

    @Override
    public ResultModel delete(@RequestBody GoodsTypeDeleteRequest request) {

        goodsFacadeService.removeGoodsTypeWithCheck(request.getGoodsTypeId());

        return ResultModel.success();
    }
}
